/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Own implementation of the box2d
 * contact listener, which after impact pays attention
 * to the reaction forces applied to the joints
 * and decides whether to break them or not
 * Only instantiated once from the GameEngine
 * and used during the whole game
 */

#ifndef GAMECONTACTLISTENER_H
#define GAMECONTACTLISTENER_H

#include "Box2D/Box2D.h"
#include <vector>

class GameEngine;

class GameContactListener : public b2ContactListener {
public:
	// default constructor
	GameContactListener( GameEngine *gameEngine );
	// default destructor
	~GameContactListener();

	// called when the contact begins
	virtual void BeginContact( b2Contact* contact );
	// called after the impact
	virtual void EndContact( b2Contact* contact );
	// called before contact is about to happen
	virtual void PreSolve( b2Contact* contact, const b2Manifold* oldManifold );
	// called after everything has happened
	virtual void PostSolve( b2Contact* contact, const b2ContactImpulse* impulse );

private:
	// pointer to the game engine
	GameEngine *mGameEngine;
};

#endif